home *** CD-ROM | disk | FTP | other *** search
- Path: newsbf02.news.aol.com!not-for-mail
- From: jwpirie@aol.com (JWPirie)
- Newsgroups: comp.lang.c++
- Subject: Re: private base class vs. private member object
- Date: 11 Mar 1996 08:23:24 -0500
- Organization: America Online, Inc. (1-800-827-6364)
- Sender: root@newsbf02.news.aol.com
- Message-ID: <4i19gc$85f@newsbf02.news.aol.com>
- References: <3141CB3E.5A36@staff.ichange.com>
- Reply-To: jwpirie@aol.com (JWPirie)
- NNTP-Posting-Host: newsbf02.mail.aol.com
-
- Remember Booch's guidelines: Inheritance (private or public) should be an
- "is a" relationship. Member objects should be a "part of" relationship.
-
- If your base class is Airplane and you want to create a Boeing747 class,
- you should probably be inheriting. If your base class is JetEngine and
- you want to create Boeing747, you should probably make JetEngine a member
- object.
-
- And if access is a problem with the appropriate relationship, you may want
- to rethink your base class structure.
-
-
- --------------------
- John Pirie
- Cohane Rafferty Securities, Inc.
- Harrison, NY
- "I'd keep playing -- I don't think the heavy stuff's comin' down for quite
- a while yet."
-